home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9284 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 6e | 74 70 2d 74 72 64 2e 55 |Path: nn|tp-trd.U|
|00000010| 4e 49 4e 45 54 54 2e 6e | 6f 21 75 73 65 6e 65 74 |NINETT.n|o!usenet|
|00000020| 0a 46 72 6f 6d 3a 20 50 | 61 75 6c 20 4b 65 6e 6e |.From: P|aul Kenn|
|00000030| 65 74 68 20 45 67 65 6c | 6c 2d 6a 6f 68 6e 73 65 |eth Egel|l-johnse|
|00000040| 6e 20 3c 70 61 75 6c 6b | 65 6e 34 40 61 66 72 6f |n <paulk|en4@afro|
|00000050| 64 69 74 65 2e 6b 69 68 | 2e 6e 6f 3e 0a 4e 65 77 |dite.kih|.no>.New|
|00000060| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 6c 61 |sgroups:| comp.la|
|00000070| 6e 67 2e 63 2b 2b 0a 53 | 75 62 6a 65 63 74 3a 20 |ng.c++.S|ubject: |
|00000080| 52 65 3a 20 53 61 76 69 | 6e 67 20 61 20 43 2b 2b |Re: Savi|ng a C++|
|00000090| 20 6f 62 6a 65 63 74 0a | 44 61 74 65 3a 20 54 68 | object.|Date: Th|
|000000a0| 75 2c 20 32 39 20 46 65 | 62 20 31 39 39 36 20 32 |u, 29 Fe|b 1996 2|
|000000b0| 30 3a 33 36 3a 30 34 20 | 2b 30 31 30 30 0a 4f 72 |0:36:04 |+0100.Or|
|000000c0| 67 61 6e 69 7a 61 74 69 | 6f 6e 3a 20 55 4e 49 4e |ganizati|on: UNIN|
|000000d0| 45 54 54 20 6e 65 77 73 | 20 73 65 72 76 69 63 65 |ETT news| service|
|000000e0| 09 0a 4d 65 73 73 61 67 | 65 2d 49 44 3a 20 3c 33 |..Messag|e-ID: <3|
|000000f0| 31 33 36 30 30 32 34 2e | 34 34 43 39 40 61 66 72 |1360024.|44C9@afr|
|00000100| 6f 64 69 74 65 2e 6b 69 | 68 2e 6e 6f 3e 0a 52 65 |odite.ki|h.no>.Re|
|00000110| 66 65 72 65 6e 63 65 73 | 3a 20 3c 33 31 33 35 43 |ferences|: <3135C|
|00000120| 37 34 45 2e 34 34 36 42 | 39 42 33 44 40 64 6f 63 |74E.446B|9B3D@doc|
|00000130| 2e 69 63 2e 61 63 2e 75 | 6b 3e 0a 4e 4e 54 50 2d |.ic.ac.u|k>.NNTP-|
|00000140| 50 6f 73 74 69 6e 67 2d | 48 6f 73 74 3a 20 61 66 |Posting-|Host: af|
|00000150| 72 6f 64 69 74 65 2e 6b | 69 68 2e 6e 6f 0a 4d 69 |rodite.k|ih.no.Mi|
|00000160| 6d 65 2d 56 65 72 73 69 | 6f 6e 3a 20 31 2e 30 0a |me-Versi|on: 1.0.|
|00000170| 43 6f 6e 74 65 6e 74 2d | 54 79 70 65 3a 20 74 65 |Content-|Type: te|
|00000180| 78 74 2f 70 6c 61 69 6e | 3b 20 63 68 61 72 73 65 |xt/plain|; charse|
|00000190| 74 3d 75 73 2d 61 73 63 | 69 69 0a 43 6f 6e 74 65 |t=us-asc|ii.Conte|
|000001a0| 6e 74 2d 54 72 61 6e 73 | 66 65 72 2d 45 6e 63 6f |nt-Trans|fer-Enco|
|000001b0| 64 69 6e 67 3a 20 37 62 | 69 74 0a 58 2d 4d 61 69 |ding: 7b|it.X-Mai|
|000001c0| 6c 65 72 3a 20 4d 6f 7a | 69 6c 6c 61 20 32 2e 30 |ler: Moz|illa 2.0|
|000001d0| 20 28 58 31 31 3b 20 49 | 3b 20 48 50 2d 55 58 20 | (X11; I|; HP-UX |
|000001e0| 41 2e 30 39 2e 30 35 20 | 39 30 30 30 2f 37 32 30 |A.09.05 |9000/720|
|000001f0| 29 0a 54 6f 3a 20 42 65 | 6e 20 4a 65 66 66 65 72 |).To: Be|n Jeffer|
|00000200| 79 73 20 3c 62 72 6a 40 | 64 6f 63 2e 69 63 2e 61 |ys <brj@|doc.ic.a|
|00000210| 63 2e 75 6b 3e 0a 0a 42 | 65 6e 20 4a 65 66 66 65 |c.uk>..B|en Jeffe|
|00000220| 72 79 73 20 77 72 6f 74 | 65 3a 0a 0a 3e 20 57 68 |rys wrot|e:..> Wh|
|00000230| 61 74 20 2a 65 78 61 63 | 74 6c 79 2a 20 69 73 20 |at *exac|tly* is |
|00000240| 73 61 76 65 64 3f 20 49 | 27 6d 20 66 69 6e 64 69 |saved? I|'m findi|
|00000250| 6e 67 20 74 68 61 74 20 | 65 76 65 72 79 20 74 69 |ng that |every ti|
|00000260| 6d 65 20 49 20 72 65 63 | 6f 6d 70 69 6c 65 0a 3e |me I rec|ompile.>|
|00000270| 20 61 6e 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 | an appl|ication |
|00000280| 77 68 65 6e 20 49 27 76 | 65 20 61 64 64 65 64 20 |when I'v|e added |
|00000290| 73 6f 6d 65 20 6e 65 77 | 20 63 6f 64 65 2c 20 74 |some new| code, t|
|000002a0| 72 79 69 6e 67 20 74 6f | 20 6c 6f 61 64 0a 3e 20 |rying to| load.> |
|000002b0| 61 6e 20 6f 62 6a 65 63 | 74 20 73 61 76 65 64 20 |an objec|t saved |
|000002c0| 69 6e 20 74 68 69 73 20 | 77 61 79 20 77 69 74 68 |in this |way with|
|000002d0| 20 61 6e 20 6f 6c 64 20 | 76 65 72 73 69 6f 6e 20 | an old |version |
|000002e0| 6f 66 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |of the a|pplicati|
|000002f0| 6f 6e 0a 3e 20 63 72 61 | 73 68 65 73 20 69 74 2c |on.> cra|shes it,|
|00000300| 20 65 76 65 6e 20 69 66 | 20 74 68 65 20 63 6c 61 | even if| the cla|
|00000310| 73 73 20 6f 66 20 74 68 | 65 20 6f 62 6a 65 63 74 |ss of th|e object|
|00000320| 20 69 6e 20 71 75 65 73 | 74 69 6f 6e 20 68 61 73 | in ques|tion has|
|00000330| 6e 27 74 0a 3e 20 63 68 | 61 6e 67 65 64 2e 20 49 |n't.> ch|anged. I|
|00000340| 20 70 72 65 73 75 6d 65 | 20 74 68 65 72 65 20 61 | presume| there a|
|00000350| 72 65 20 73 6f 6d 65 20 | 70 6f 69 6e 74 65 72 73 |re some |pointers|
|00000360| 20 6f 72 20 73 6f 6d 65 | 74 68 69 6e 67 20 77 68 | or some|thing wh|
|00000370| 69 63 68 20 61 72 65 0a | 3e 20 63 68 61 6e 67 69 |ich are.|> changi|
|00000380| 6e 67 20 77 68 65 6e 20 | 49 20 61 64 64 20 6e 65 |ng when |I add ne|
|00000390| 77 20 63 68 75 6e 6b 73 | 20 6f 66 20 63 6f 64 65 |w chunks| of code|
|000003a0| 2e 20 57 68 61 74 20 63 | 61 6e 20 49 20 64 6f 20 |. What c|an I do |
|000003b0| 74 6f 20 61 76 6f 69 64 | 20 74 68 69 73 3f 0a 0a |to avoid| this?..|
|000003c0| 57 68 65 6e 20 75 73 69 | 6e 67 20 76 69 72 74 75 |When usi|ng virtu|
|000003d0| 61 6c 20 66 75 6e 63 74 | 69 6f 6e 73 20 6d 61 6b |al funct|ions mak|
|000003e0| 65 20 73 75 72 65 20 61 | 20 63 6c 61 73 73 20 74 |e sure a| class t|
|000003f0| 68 61 74 20 72 65 61 64 | 73 20 61 6e 0a 6f 62 6a |hat read|s an.obj|
|00000400| 65 63 74 20 69 73 20 5f | 69 64 65 6e 74 69 63 61 |ect is _|identica|
|00000410| 6c 5f 20 74 6f 20 74 68 | 65 20 63 6c 61 73 73 20 |l_ to th|e class |
|00000420| 74 68 61 74 20 77 72 6f | 74 65 20 69 74 2e 0a 0a |that wro|te it...|
|00000430| 49 66 20 79 6f 75 20 64 | 6f 6e 27 74 20 75 73 65 |If you d|on't use|
|00000440| 20 76 69 72 74 75 61 6c | 20 66 75 6e 63 74 69 6f | virtual| functio|
|00000450| 6e 73 20 74 68 65 6e 20 | 6f 6e 6c 79 20 74 68 65 |ns then |only the|
|00000460| 20 64 61 74 61 20 6d 65 | 6d 62 65 72 73 0a 73 68 | data me|mbers.sh|
|00000470| 6f 75 6c 64 20 62 65 20 | 74 68 65 20 73 61 6d 65 |ould be |the same|
|00000480| 2e 2e 2e 0a 0a 54 68 61 | 74 73 20 41 46 41 49 4b |.....Tha|ts AFAIK|
|00000490| 20 62 61 73 65 64 20 6f | 6e 20 62 6f 6f 6b 73 20 | based o|n books |
|000004a0| 49 20 68 61 76 65 20 72 | 65 61 64 2e 0a 0a 0a 3e |I have r|ead....>|
|000004b0| 20 41 6c 73 6f 2c 20 69 | 73 20 74 68 65 72 65 20 | Also, i|s there |
|000004c0| 61 6e 79 74 68 69 6e 67 | 20 64 6f 64 67 79 20 61 |anything| dodgy a|
|000004d0| 62 6f 75 74 20 73 61 76 | 69 6e 67 20 61 20 63 6c |bout sav|ing a cl|
|000004e0| 61 73 73 20 66 72 6f 6d | 20 77 69 74 68 69 6e 20 |ass from| within |
|000004f0| 69 74 73 65 6c 66 2c 0a | 3e 20 75 73 69 6e 67 3a |itself,.|> using:|
|00000500| 0a 3e 20 0a 3e 20 66 69 | 6c 65 2e 77 72 69 74 65 |.> .> fi|le.write|
|00000510| 28 28 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 20 |((unsign|ed char |
|00000520| 2a 29 20 26 74 68 69 73 | 2c 20 73 69 7a 65 6f 66 |*) &this|, sizeof|
|00000530| 28 6f 76 6f 69 64 29 29 | 0a 0a 4e 6f 2c 20 69 6e |(ovoid))|..No, in|
|00000540| 20 66 61 63 74 20 49 20 | 77 6f 75 6c 64 20 63 61 | fact I |would ca|
|00000550| 6c 6c 20 69 74 20 70 72 | 65 66 65 72 72 65 64 2e |ll it pr|eferred.|
|00000560| 20 41 64 64 20 61 20 66 | 72 69 65 6e 64 20 69 73 | Add a f|riend is|
|00000570| 74 72 65 61 6d 20 3e 3e | 0a 6f 70 65 72 61 74 6f |tream >>|.operato|
|00000580| 72 20 61 6e 64 20 61 20 | 66 72 69 65 6e 64 20 6f |r and a |friend o|
|00000590| 73 74 72 65 61 6d 20 3c | 3c 20 6f 70 65 72 61 74 |stream <|< operat|
|000005a0| 6f 20 72 69 6e 20 79 6f | 75 72 20 63 6c 61 73 73 |o rin yo|ur class|
|000005b0| 2c 20 61 6e 64 0a 74 68 | 65 6e 20 79 6f 75 20 68 |, and.th|en you h|
|000005c0| 61 76 65 20 74 68 65 20 | 73 74 61 6e 64 61 72 64 |ave the |standard|
|000005d0| 20 69 6e 74 65 72 66 61 | 63 65 20 66 6f 72 20 61 | interfa|ce for a|
|000005e0| 6c 6c 20 79 6f 75 72 20 | 63 6c 61 73 73 65 73 2c |ll your |classes,|
|000005f0| 20 77 68 65 6e 0a 69 74 | 20 63 6f 6d 65 73 20 74 | when.it| comes t|
|00000600| 6f 20 73 61 76 69 6e 67 | 20 74 6f 20 66 69 6c 65 |o saving| to file|
|00000610| 73 2e 20 28 4a 75 73 74 | 20 6c 69 6b 65 20 79 6f |s. (Just| like yo|
|00000620| 75 20 6d 61 6b 65 20 69 | 2f 6f 73 74 72 65 61 6d |u make i|/ostream|
|00000630| 0a 66 72 69 65 6e 64 73 | 20 66 6f 72 20 73 74 61 |.friends| for sta|
|00000640| 6e 64 61 72 64 20 69 6e | 74 65 72 66 61 63 65 20 |ndard in|terface |
|00000650| 74 6f 20 63 69 6e 2c 20 | 63 6f 75 74 20 61 6e 64 |to cin, |cout and|
|00000660| 20 63 65 72 72 29 2e 0a | 0a 4d 69 6e 6f 72 20 70 | cerr)..|.Minor p|
|00000670| 6f 69 6e 74 2c 20 77 68 | 79 20 6e 6f 74 20 73 69 |oint, wh|y not si|
|00000680| 7a 65 6f 66 28 2a 74 68 | 69 73 29 2c 20 6a 75 73 |zeof(*th|is), jus|
|00000690| 74 20 74 6f 20 74 65 6c | 6c 20 74 68 65 20 72 65 |t to tel|l the re|
|000006a0| 61 64 65 72 20 77 68 61 | 74 0a 77 65 20 61 72 65 |ader wha|t.we are|
|000006b0| 20 74 61 6c 6b 69 6e 67 | 20 61 62 6f 75 74 2e 2e | talking| about..|
|000006c0| 2e 0a 0a 50 61 75 6c 20 | 4b 20 45 67 65 6c 6c 2d |...Paul |K Egell-|
|000006d0| 4a 6f 68 6e 73 65 6e 2c | 0a 0a 6d 61 69 6c 74 6f |Johnsen,|..mailto|
|000006e0| 3a 70 61 75 6c 6b 65 6e | 34 40 61 66 72 6f 64 69 |:paulken|4@afrodi|
|000006f0| 74 65 2e 6b 69 68 2e 6e | 6f 0a 68 74 74 70 3a 2f |te.kih.n|o.http:/|
|00000700| 2f 61 66 72 6f 64 69 74 | 65 2e 6b 69 68 2e 6e 6f |/afrodit|e.kih.no|
|00000710| 3a 38 30 30 31 2f 73 74 | 75 64 65 6e 74 65 72 2f |:8001/st|udenter/|
|00000720| 70 61 75 6c 6b 65 6e 34 | 2f 66 72 61 6d 65 73 2f |paulken4|/frames/|
|00000730| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+